#include<iostream>
#include<stdio.h>
#pragma warning(disable:4996)
using namespace std;
/*
int main(){
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	int n,L,R,ans=0;
	cin>>n>>L>>R;
	for(int i=L;i<=R;i++){
		ans=max(ans,i%n);
	}
	cout<<ans;
}
*/